#ifndef GAMEENGINE_HEADER
#define GAMEENGINE_HEADER

#include <iostream>
#include <fstream>
#include <list>
#include <windows.h>		// Header File For Windows
#include "Graphics\AbstractClasses\Renderer.h"
#include "Entities\AbstractClasses\GameEntity.h"
#include "Inputs\InputManager.h"
#include "Inputs\AbstractClasses\KeyboardListener.h"
#include "Plugin\PluginManager.h"

class GameEngine : public KeyboardListener {

public:
	Renderer * getRenderer() const;				//returns renderer

	static GameEngine* Instance();
	bool Initialize();							// Initialize the engine (create the window)
	void ResizeWindow(int,int);					// Resize the window
	
	void Draw();								//Draw called from the game
	void Update();								//Update called from the game

	void ToggleFullScreenMode();				// Toggle between fullscreen and window mode
	void CloseWindow();							// Close the rendering window

	state getGameState();						//Returns the updated gamestate
	void setGameState(state);					//Sets a new gamestate

	virtual void onKeyPressed(int);						//When a key is pressed
	virtual void onKeyReleased(int);					//When a key is released
	
	virtual void createScene() = 0;				//Creates a scene
	virtual void deleteScene() = 0;				//Deletes a scene
	
protected:
	GameEngine(WNDPROC);						// Contrustor
	~GameEngine();								// Destructor
	Renderer * _renderer;						//The renderer
	static GameEngine* _instance;
private:
	state _state;
	std::ofstream oss;

};

#endif